import { request } from '@/utils/request'

// 创建聊天会话
export function createSession() {
  return request({
    url: '/chat/session/create',
    method: 'post'
  })
}

// 结束聊天会话
export function endSession(sessionId) {
  return request({
    url: '/chat/session/end',
    method: 'post',
    params: { sessionId }
  })
}

// 获取用户聊天消息列表
export function getCustomerMessageList(params) {
  return request({
    url: '/chat/customer/list',
    method: 'get',
    params
  })
}

// 获取医生聊天消息列表
export function getDoctorMessageList(params) {
  return request({
    url: '/chat/doctor/list',
    method: 'get',
    params
  })
}

// 上传聊天图片
export function uploadChatImage(data) {
  return request({
    url: '/chat/upload/image',
    method: 'post',
    data,
    headers: { 'Content-Type': 'multipart/form-data' }
  })
}